home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / packet / p_aa4re / bb212src / bbfwdspr.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-02-16  |  1.5 KB  |  50 lines

  1. (*===========================================================================*)
  2. (* Forward task -- Wait for prompt                                           *)
  3. (*                                                                           *)
  4. (*   Copyright 1988, 1989 by H. Roy Engehausen.  All rights reserved.        *)
  5. (*                                                                           *)
  6. (*===========================================================================*)
  7.  
  8. (*===========================================================================*)
  9. (* Wait for a prompt                                                         *)
  10. (*===========================================================================*)
  11.  
  12. PROCEDURE forward_wait_prompt(path_common : path_block_ptr;
  13.                               first_prompt : BOOLEAN);
  14.  
  15.   VAR
  16.     i        : BYTE;
  17.     response : STRING;
  18.  
  19.   BEGIN;
  20.  
  21.     WHILE TRUE DO
  22.       BEGIN;
  23.  
  24.         task_switch;
  25.  
  26.         response := read_tnc_data_str;
  27.         strip_crlf(response);
  28.  
  29.         i := LENGTH(response);
  30.  
  31.         IF (i > 0) THEN
  32.           BEGIN;
  33.  
  34.             IF response[i] = '>' THEN EXIT;
  35.  
  36.             IF first_prompt AND (response[1] = '[') AND (response[i] = ']') THEN
  37.               WITH active_tcb^, active_tcb^.uid_data DO
  38.                 BEGIN;
  39.                   i := POS('-', response);
  40.                   IF i <> 0 THEN
  41.                     process_sid(@response);
  42.                   first_prompt := FALSE;
  43.                 END;
  44.  
  45.           END;
  46.  
  47.       END;
  48.  
  49.   END;
  50.